<template>
	<view>
		<view class="tab_contents">
			<view class="tab_item" @tap="changeme(tab_index)" v-for="(item,tab_index) in datalist" :class="tab_index == index ? 'tab_choice' : ''">
				{{item}}
			</view>
		</view>
		<view :style="{'height':100+'rpx'}"></view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				
			}
		},
		props: {
			datalist: {
				default: Array,
				type: Array
			},
			index: {
				default: 0,
				type: Number
			},
		},
		methods: {
			changeme(index){
				this.$emit("navchange",index);
			}
		}
	}
</script>

<style lang="scss">
.tab_contents{
	position: fixed;
	z-index: 99999;
	width: 98%;
	display: flex;
	flex-direction: row;
	justify-content: space-around;
	align-items: center;
	background-color: #fff;
	padding: 20rpx 10rpx;
	.tab_item{
		
	}
}
.tab_choice{
	color: #27c18b;
	border-bottom: 4rpx solid #27c18b;
	padding: 5rpx;
}
</style>
